[14.0][FIX] website_sale_extra_fields: slug_name NOT NULL on fresh install#870
Closed
[14.0][FIX] website_sale_extra_fields: slug_name NOT NULL on fresh install#870
Conversation
Add pre_init_hook to pre-create the slug_name column and fill existing rows with a placeholder value before _auto_init runs. This prevents the SET NOT NULL constraint from failing when product_public_category records already exist from website_sale demo data.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 14.0 #870 +/- ##
==========================================
+ Coverage 50.53% 50.58% +0.05%
==========================================
Files 979 980 +1
Lines 16685 16692 +7
Branches 3558 3558
==========================================
+ Hits 8432 8444 +12
+ Misses 8034 8033 -1
+ Partials 219 215 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pre_init_hookto pre-create theslug_namecolumn onproduct_public_categoryand fill existing NULL rows with a placeholder before_auto_initrunsERROR: column "slug_name" contains null valueswhen installing on a database that already hasproduct.public.categoryrecords (e.g. fromwebsite_saledemo data)Test plan
website_sale_extra_fieldson a fresh database with demo data enabled — should not crashslug_nameis computed correctly after install